//
//  YWLoginTool.h
//  maintain
//
//  Created by 郑想 on 15/10/23.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#include "YWLoginUser.h"

@interface YWLoginTool : NSObject

/**
 *  保存登录用户数据
 *
 *  @param user 登录用户对象
 *
 *  @return 保存结果
 */
+ (BOOL)saveLoginOfUser:(YWLoginUser*)user;

/**
 *  获取登录对象数据
 *
 *  @return 登录对象
 */
+ (YWLoginUser*)loginUser;

/**
 *  保存登录状态 YES已登录(自动保存登录时间) NO未登录
 *
 *  @param status 登录状态
 */
+ (void)saveLoginofStatus:(BOOL)status;

/**
 *  用户是否已经登录
 *
 *  @return 结果 YES已经登录
 */
+ (BOOL)isLogin;

/**
 *  保存应用key，参与签名，身份验证需要，保密
 *
 *  @param appKey key
 */
+ (void)saveRequestHeadAppKey:(NSString*)appKey;
/**
 *  获取应用的key
 *
 *  @return key
 */
+ (NSString*)requestHeadAppKey;
/**
 *  获取用户的数据库名称
 *
 *  @return 名称
 */
+ (NSString*)DBName;

/**
 *  预登录
 *
 *  @return 无
 */
+ (void)preLoginRequestWithUserName:(NSString*)userName passWord:(NSString*)passWord isLogin:(BOOL)isLogin completeBlock:(void(^)(NSArray *organizations))complete;
/**
 *  登录
 *
 *  @return 无
 */
+ (void)loginRequestWithOrganizationNo:(NSString*)organizationNo simpleName:(NSString*)simpleName userName:(NSString*)userName passWord:(NSString*)passWord isLogin:(BOOL)isLogin completeBlock:(void(^)(NSInteger statusCode))complete;


/**
 *  推送的临时任务的红色数字存取
 *
 *  @return 结果
 */
+ (void)saveTempMissionNoRedCount;
+ (void)saveTempMissionWithNoRedCount:(NSInteger)count;
+ (void)clearTempMissionNoRedCount;
+ (NSInteger)tempMissionNoRedCount;

/**
 *  推送的公告的红色数字存取
 *
 *  @return 结果
 */
+ (void)saveNoticeNoRedCount;
+ (void)saveNoticeWithNoRedCount:(NSInteger)count;
+ (void)clearNoticeNoRedCount;
+ (NSInteger)noticeNoRedCount;

/**
 *  推送的报障的红色数字存取
 *
 *  @return 结果
 */
+ (void)saveReportTroubleNoReadCount;
+ (void)saveReportTroubleWithNoReadCount:(NSInteger)count;
+ (void)clearReportTroubleNoReadCount;
+ (NSInteger)reportTroubleNoReadCount;
/**
 *  推送的物料的红色数字存取
 *
 *  @return 结果
 */
+ (void)saveMaterialNoReadCount;
+ (void)saveMaterialWithNoReadCount:(NSInteger)count;
+ (void)clearMaterialNoReadCount;
+ (NSInteger)materialNoReadCount;
/**
 *  推送的清点的红色数字存取
 *
 *  @return 结果
 */
+ (void)saveAssetsInventoryNoReadCount;
+ (void)saveAssetsInventoryWithNoReadCount:(NSInteger)count;
+ (void)clearAssetsInventoryNoReadCount;
+ (NSInteger)assetsInventoryNoReadCount;
/**
 *  推送的检测，保养，维修，巡查，巡更红色数字存取
 *
 *  @return 结果
 */
+ (void)saveMissionNoRedCountWithMaintenanceType:(NSInteger)maintenanceType;
+ (void)saveMissionNoRedCountWithMaintenanceType:(NSInteger)maintenanceType noReadCount:(NSInteger)count;
+ (void)clearMissionNoRedCountWithMaintenanceType:(NSInteger)maintenanceType;
+ (NSInteger)missionNoRedCountWithMaintenanceType:(NSInteger)maintenanceType;

/**
 *  发现的tabbar红色数字（通知和临时任务）
 *
 *  @return 结果
 */
+ (NSInteger)noticeAndTempMissionTotalNoRedCount;
+ (void)clearNoticeAndTempMissionTotalNoRedCount;
/**
 *  推送的消息的红色数字存取
 *
 *  @return 结果
 */
+ (void)savePushMessageNoRedCount;
+ (void)clearPushMessageNoRedCount;
+ (NSInteger)pushMessageNoRedCount;

/**
 *  首页提醒未读数字存取
 *
 *  @return 结果
 */
+ (void)saveWorkReminderNoRedCount;
+ (void)saveWorkReminderNoRedWithCount:(NSInteger)count;
+ (void)clearWorkReminderNoRedCount;
+ (NSInteger)WorkReminderNoRedCount;

/**
 *  首页监控报警未读数字存取
 *
 *  @return 结果
 */
+ (void)saveMonitorAlarmNoRedCount;
+ (void)saveMonitorAlarmNoRedWithCount:(NSInteger)count;
+ (void)clearMonitorAlarmNoRedCount;
+ (NSInteger)monitorAlarmNoRedCount;

+ (void)saveCustomDefineBuildingShowName:(NSString*)buildingShowName;
+ (NSString*)buildingShowName;

+ (void)saveCustomDefineApartmentShowName:(NSString*)apartmentShowName;
+ (NSString*)apartmentShowName;
+ (void)saveCustomDefineFloorShowName:(NSString*)floorShowName;
+ (NSString*)floorShowName;
+ (void)saveCustomDefineLocationShowName:(NSString*)locationShowName;
+ (NSString*)locationShowName;
@end
